import { request } from './axios-config'

const api = "umale-maintenance-web";
const caseApi = "umale-cases-web";

export function searchDictList(params) {
  // 单个字典项
  return request({
    url: `${api}/code/api/serarchBycodeType/${params}`,
    method: 'post'
  })
}

// 事件大类
export function searchParentEventType() {
  return request({
    url: `${api}/event/type/searchParent`,
    method: 'get'
  })
}

// 事件小类
export function searchChildEventType(parentId) {
  return request({
    url: `${api}/event/type/searchChild/${parentId}`,
    method: 'get'
  })
}

/**
 * 获取道路
 * GET /maintenance/list_road
 */
export function listRoad({
  code, // 区域编码
  street_code, // 街道编码
}) {
  return request({
    url: `${caseApi}/maintenance/list_road`,
    method: "GET",
    params: {
      code,
      street_code
    }
  });
}

// 通过用户的group下的group_no查询他所在的区域信息
export function getGroupnoToAreaCode(gropNo) {
  return request({
    url: `${api}/areaGroup/byGroupNo/${gropNo}`,
    method: 'GET'
  })
}
